package se.zens.common.exception;

import se.zens.common.PrefixProperties;


/**
 * Exception used when and error is found in a configuration
 */
public class ConfigurationException extends ZensException
{
	String filename;
	PrefixProperties properties;
	
	/**
	 * Creates a new configuration exception
	 * 
	 * @param message The error message
	 */
	public
	ConfigurationException(String message)
	{
		super(message);
	}
	
	/**
	 * Creates a new configuration exception
	 * 
	 * @param message The error message
	 * @param filename The configuration file name
	 */
	public
	ConfigurationException(String message, String filename)
	{
		super(message);
		this.filename = filename;
	}

	/**
	 * Creates a new configuration exception
	 * 
	 * @param message The error message
	 * @param filename The configuration file that was used when this exception occurred
	 * @param cause The exception causing the error
	 */
	public
	ConfigurationException(String message, String filename, Throwable cause)
	{
		super(message, cause);
	}

	/**
	 * Creates a new configuration exception
	 * 
	 * @param message The error message
	 * @param cause The exception causing the error
	 */
	public
	ConfigurationException(String message, Throwable cause)
	{
		super(message, cause);
	}
	
	/**
	 * Gets the name of the configuration file that the error was found in
	 * 
	 * @return The configuration file name, null if unknown
	 */
	public String getFilename()
	{
		return filename;
	}

	/**
	 * Sets the name of the configuration file that the error was found in
	 * 
	 * @param filename The configuration file name
	 */
	public void setFilename(String filename)
	{
		this.filename = filename;
	}

	/**
	 * Gets the properties that were used and that caused this exception
	 *  
	 * @return
	 */
	public PrefixProperties getProperties() 
	{
		return properties;
	}

	public void setProperties(PrefixProperties properties) 
	{
		this.properties = properties;
	}
	
	
	
}
